<?php

namespace app\controller\system;

use app\BaseController;
use app\model\StationOilNumber;
use think\response\Json;

class OilNumber extends BaseController
{
    public function save(): Json
    {
        return $this->handle(function () {
            return $this->app->make(StationOilNumber::class)->saveData();
        });
    }

    public function pageData(): Json
    {
        return $this->handle(function () {
            return $this->app->make(StationOilNumber::class)->pageData();
        });
    }

    public function detail()
    {
        return $this->handle(function () {
            return $this->app->make(StationOilNumber::class)->find($this->request->param("id"));
        });
    }

    public function search()
    {
        return $this->handle(function () {
            return $this->app->make(StationOilNumber::class)->where('state',1)->column("id,name");
        });
    }
}
